<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Diskussionsplattform</title>
    </h:head>
    <h:body>
        <h:outputText value="Eingeloggt als: #{nutzer.name}" /><br/>
        <div style="text-align: left; font-size: 12pt" >

            <h:outputText value="Diskussionsplattform" style ="font-size: 20pt;font-weight: bold"/><br /><br/>

            <h:form>
                <h:outputText value="Für ein neues Diskussionsforum geben Sie hier Ihre Frage ein" /><br />
                <h:inputText id="newForum" value="#{forum.theme}" size="60" />
                <h:commandButton id="addForumButton" value="Forum einrichten" action="#{controller.createForum(forum)}" /><br /><br/>

                <h:panelGrid rendered="#{!empty controller.foren}">
                    <h:outputText value="Existierende Foren" style ="font-size: 16pt;font-weight: bold"/><br /><br/>
                    <h:dataTable value="#{controller.foren}" var="fo"  >
                        <h:column>
                            <ui:param name="target" value="#{fo}"/>
                            <h:commandLink id="stinker" style="text-align: center" value="#{fo.theme}" action="#{controller.toTopic(target)}"/>
                        </h:column>
                        <h:column>
                            <h:outputText value=" Bisherige Kommentare: #{fo.replyCount()}"/>
                        </h:column>

                    </h:dataTable>
                </h:panelGrid>
            </h:form>
            <h:form>
            <h:commandButton value="Logout" action="#{controller.ausloggen(nutzer)}" />
            </h:form>
        </div>
    </h:body>
</html>